package com.daxue.configtest.config;

import com.daxue.configtest.service.RemoteConfigService;
import lombok.RequiredArgsConstructor;
import org.springframework.cloud.config.server.environment.EnvironmentRepositoryFactory;

/**
 * @author daxue0929
 * @date 2023/3/25
 */
@RequiredArgsConstructor
public class LocalEnvironmentRepositoryFactory implements EnvironmentRepositoryFactory<LocalEnvironmentRepository, LocalEnvironmentProperties> {


    private final RemoteConfigService remoteConfigService;

    @Override
    public LocalEnvironmentRepository build(LocalEnvironmentProperties environmentProperties) {
        return new LocalEnvironmentRepository(remoteConfigService, environmentProperties);
    }
}
